package me.lubinn.Vicincantatio.Spells;

import java.util.HashMap;
import java.util.Map;

import org.bukkit.Material;
import org.bukkit.event.player.PlayerChatEvent;




public class Delay
{
	static final Map<String, Spell> delay = new HashMap<String, Spell>();
	static Material material;
	static int size1;
	static Map<String, Boolean> aug;
	static String spellName;
	
	public static void delay(String name, Spell spell, PlayerChatEvent ev, Material mat, int size, Map<String, Boolean> augments)
	{
		delay.put(ev.getPlayer().getName(), spell);		
		material = mat;
		size1 = size;
		aug = augments;
		spellName = name;
		
	}	

	public static void release(PlayerChatEvent ev)
	{
		Spell toCast = delay.get(ev.getPlayer().getName());
		if (toCast != null)
		{
			//Cast the damn thing
			delay.get(ev.getPlayer().getName()).CastSpell(ev, material, size1, aug);
			
			//Set up itero to repeat the thingy u said before delaying it
			//Vicincantatio.prop.put(ev.getPlayer().getName(), spellName);
			
			//Remove from map of delays
			delay.remove(ev.getPlayer().getName());
		}
			
	}
}